package tp3;

import java.text.DecimalFormat;

abstract class FigureOrdonnableID implements Ordonnable<FigureOrdonnableID> {
	
	DecimalFormat df = new DecimalFormat("0.000");
	
	protected static int n = 0;
	
	protected int id;
	
	FigureOrdonnableID (){
		
		super();
		
		id = n;
		
		n++;
	}
			
	abstract double calculerAire();
	
	public String toString (){
		
		return "\n"+this.getClass().getName() +"\t ID :\t"+this.id+ "\t Aire :\t"+df.format(this.calculerAire());
		
	}
	
	public boolean estPlusGrand (FigureOrdonnableID f){
		
		return this.id > f.id;
		
	}
	
}
